#ifndef IRENDERER_H
#define IRENDERER_H

#include "GfxModel.h"
#include <utils/String.h>
#include <utils/Maths.h>

class I2DCamera
{
public:
	virtual void update() = 0;
	
	virtual void track( const Vector* vPos ) = 0;
	virtual void setPos( Vector vPos ) = 0;
	virtual void moveTo( Vector vPos ) = 0;
	virtual void setZoom( Scalar fValue ) = 0;
	virtual void zoomTo( Scalar fValue ) = 0;
	virtual void setAngle( Scalar fValue ) = 0;
	virtual void rotateTo( Scalar fAngle ) = 0;
	
	//virtual void setMaxAccel( Scalar fValue ) = 0;
	//virtual void setMaxSpeed( Scalar fValue ) = 0;
	//virtual void setMaxZoomAccel( Scalar fValue ) = 0;
	//virtual void setMaxZoomSpeed( Scalar fValue ) = 0;
	//virtual void setMaxAngAccel( Scalar fValue ) = 0;
	//virtual void setMaxAngSpeed( Scalar fValue ) = 0;
};

class IRenderer
{
	
public:
    
    //TODO: Work out how best to enforce passing of pEngine parameter to constructor
    //TODO: Work out why this works when it is not public!!
    IRenderer()          {}
    virtual ~IRenderer() {}
    
    virtual bool init( String sTitle, unsigned iWidth, unsigned iHeight, unsigned iBitsPerPixel, bool bFullscreen ) = 0;
    virtual void resize( unsigned iWidth, unsigned iHeight ) = 0;
    //Called once per frame (at start)
    virtual bool update() = 0;
    //Called once per frame (at end)
    virtual void renderScene() = 0;
    
    //Returns whether the renderer device is active and thus whether the game loop should pause
    virtual bool isActive() = 0;
    //Returns whether the renderer has received a quit message and thus the game loop should end
    virtual bool isQuit() = 0;
    
    virtual unsigned getWidth() = 0;
    virtual unsigned getHeight() = 0;
    
    virtual I2DCamera* getCamera() = 0;
    
    //These are used to alter the transformation matrices before rendering
    virtual void beginTransformation() = 0;
    virtual void endTransformation() = 0;
    virtual void translate( const Vector& vOffset ) = 0;
    virtual void rotate( Scalar fAngle, Vector vAxis = Vector(0, 0, 1) ) = 0;
    virtual void scale( const Vector& vScale ) = 0;
    
    virtual void drawGfxModel( const GfxModel& model ) = 0;
    
public:
    
    //TODO: We may want to add some basic drawing methods here, e.g., rectangles, circles, text etc.
    ////virtual void setColor() = 0;
    ////virtual void drawTri(double fCoords[3]) = 0;
    
    //TODO: Should create a GfxModel object that contains all of the data necessary for
    //      rendering a graphical model. This method can then be used to render the object
    //      according to the implementation.
    //virtual void drawModel( GfxModel* pModel ) = 0;

};


#endif //IRENDERER_H
